// File Name: RotateClientSideCustomProvider.h

#ifndef ROTATECLIENTSIDECUSTOMPROVIDER_H
#define ROTATECLIENTSIDECUSTOMPROVIDER_H

#include <UIAutomationCoreApi.h>

#include "ICustomProvider.h"
#include "CustomLookupIds.h"

namespace UIAutomationCPP
{
	public class RotateClientSideCustomProvider : public ICustomProvider
	{
		public:
			RotateClientSideCustomProvider();
			RotateClientSideCustomProvider(HWND owner);
			virtual ~RotateClientSideCustomProvider();
			RotateClientSideCustomProvider& operator =(RotateClientSideCustomProvider& rhs);

			void InsertProxy();
			void get_ProxyTable(IUIAutomation* pAutomation);
			void InitIds();
			int CustomUiaIdLookup(AutomationIdentifierType type, GUID* pGuid);

			STDMETHODIMP GetPropertyValue(PROPERTYID propertyId, VARIANT *pRetVal);
			STDMETHODIMP GetPatternProvider(PATTERNID patternId, IUnknown** pRetVal);
			STDMETHODIMP get_HostRawElementProvider(IRawElementProviderSimple** pRetVal);
			STDMETHODIMP get_ProviderOptions( ProviderOptions* pRetVal );

			STDMETHODIMP get_IsReadOnly(BOOL *pIsReadOnly);
			STDMETHODIMP get_Value(BSTR *pValue);
			STDMETHODIMP SetValue(LPCWSTR pNewValue);
			STDMETHODIMP Reset();

			HRESULT __stdcall QueryInterface(REFIID riid, void **ppvObj);
			ULONG __stdcall AddRef();
			ULONG __stdcall Release();

		private:
			ULONG refCount;
			HWND controlHWnd;
			LPCWSTR rotateValue;
			CustomIds Ids;
			IUIAutomationProxyFactory* factory;
			IUIAutomationProxyFactoryEntry* entry;
			IUIAutomationProxyFactoryMapping* pMap;
	};
}
#endif
